<template>
  <div>
    <li>
        <div><a :href="'/addcourse?cid='+data.id">{{data.name}}</a></div>
        <ul v-if="data.children && data.children.length > 0">
            <mycate v-for="child in data.children" :key="child.id" :data="child"></mycate>
        </ul>
    </li>
  </div>
</template>

<script>
export default {
  name:'mycate',
  props:['data'],
  data() {
    return {
      catelist: [],
    };
  },
  created() {
    this.axios
      .get("http://127.0.0.1:8000/get_cate")
      .then((resp) => {
        console.log(resp.data);
        this.catelist = resp.data;
      })
      .catch((error) => {
        console.log(error);
      });
  },
};
</script>

<style>
</style>